Eclipse Platform
Pre-release 3.0

org.eclipse.ui.texteditor
Class DefaultMarkerAnnotationAccess

java.lang.Object
  extended byorg.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess
All Implemented Interfaces:
IAnnotationAccess, IAnnotationAccessExtension

public class DefaultMarkerAnnotationAccess
extends Object
implements IAnnotationAccess, IAnnotationAccessExtension

Since:
2.1

Field Summary
static String BOOKMARK_SYSTEM_IMAGE
          Constant for the bookmark system image.
static String ERROR_SYSTEM_IMAGE
          Constant for the error system image.
protected  MarkerAnnotationPreferences fMarkerAnnotationPreferences
          Deprecated. since 3.0
static String INFO_SYSTEM_IMAGE
          Constant for the info system image.
static String TASK_SYSTEM_IMAGE
          Constant for the task system image.
static String UNKNOWN
          Deprecated. use Annotation.TYPE_UNKNOWN instead
static String WARNING_SYSTEM_IMAGE
          Constant for the warning system image.
 
Fields inherited from interface org.eclipse.jface.text.source.IAnnotationAccessExtension
DEFAULT_LAYER
 
Constructor Summary
DefaultMarkerAnnotationAccess()
          Creates a new default marker annotation access using the standard preference lookup strategy which is the one provided by the enclosing plug-in.
DefaultMarkerAnnotationAccess(MarkerAnnotationPreferences markerAnnotationPreferences)
          Deprecated. use DefaultMarkerAnnotationAccess() instead
 
Method Summary
protected  AnnotationPreferenceLookup getAnnotationPreferenceLookup()
          Returns the annotation preference lookup used by this annotation access.
protected  AnnotationTypeHierarchy getAnnotationTypeHierarchy()
          Returns the annotation type hierarchy used by this annotation access.
 int getLayer(Annotation annotation)
          Returns the layer for given annotation.
 Object[] getSupertypes(Object annotationType)
          Returns the list of super types for the given annotation type.
 Object getType(Annotation annotation)
          Returns the type of the given annotation.
 String getTypeLabel(Annotation annotation)
          Returns the label for the given annotation's type.
 boolean isMultiLine(Annotation annotation)
          Returns whether the given annotation spans multiple lines.
 boolean isSubtype(Object annotationType, Object potentialSupertype)
          Returns true if the given annotation is of the given type or false otherwise.
 boolean isTemporary(Annotation annotation)
          Returns whether the given annotation is temporary rather than persistent.
 void paint(Annotation annotation, GC gc, Canvas canvas, Rectangle bounds)
          Draws a graphical representation of the given annotation within the given bounds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final String UNKNOWN
Deprecated. use Annotation.TYPE_UNKNOWN instead

Constant for the unknown marker type

See Also:
Constant Field Values

ERROR_SYSTEM_IMAGE

public static final String ERROR_SYSTEM_IMAGE
Constant for the error system image. Value: error

Since:
3.0
See Also:
Constant Field Values

WARNING_SYSTEM_IMAGE

public static final String WARNING_SYSTEM_IMAGE
Constant for the warning system image. Value: warning

Since:
3.0
See Also:
Constant Field Values

INFO_SYSTEM_IMAGE

public static final String INFO_SYSTEM_IMAGE
Constant for the info system image. Value: info

Since:
3.0
See Also:
Constant Field Values

TASK_SYSTEM_IMAGE

public static final String TASK_SYSTEM_IMAGE
Constant for the task system image. Value: task

Since:
3.0
See Also:
Constant Field Values

BOOKMARK_SYSTEM_IMAGE

public static final String BOOKMARK_SYSTEM_IMAGE
Constant for the bookmark system image. Value: bookmark

Since:
3.0
See Also:
Constant Field Values

fMarkerAnnotationPreferences

protected MarkerAnnotationPreferences fMarkerAnnotationPreferences
Deprecated. since 3.0

The marker annotation preferences

Constructor Detail

DefaultMarkerAnnotationAccess

public DefaultMarkerAnnotationAccess(MarkerAnnotationPreferences markerAnnotationPreferences)
Deprecated. use DefaultMarkerAnnotationAccess() instead

Returns a new default marker annotation access with the given preferences.

Parameters:
markerAnnotationPreferences -

DefaultMarkerAnnotationAccess

public DefaultMarkerAnnotationAccess()
Creates a new default marker annotation access using the standard preference lookup strategy which is the one provided by the enclosing plug-in.

Since:
3.0
Method Detail

getAnnotationPreferenceLookup

protected AnnotationPreferenceLookup getAnnotationPreferenceLookup()
Returns the annotation preference lookup used by this annotation access.

Returns:
the annotation preference lookup
Since:
3.0

getType

public Object getType(Annotation annotation)
Description copied from interface: IAnnotationAccess
Returns the type of the given annotation.

Specified by:
getType in interface IAnnotationAccess
Parameters:
annotation - the annotation
Returns:
the type of the given annotation or null if it has none.

isMultiLine

public boolean isMultiLine(Annotation annotation)
Description copied from interface: IAnnotationAccess
Returns whether the given annotation spans multiple lines.

Specified by:
isMultiLine in interface IAnnotationAccess
Parameters:
annotation - the annotation
Returns:
true if the annotation spans multiple lines, false otherwise

isTemporary

public boolean isTemporary(Annotation annotation)
Description copied from interface: IAnnotationAccess
Returns whether the given annotation is temporary rather than persistent.

Specified by:
isTemporary in interface IAnnotationAccess
Parameters:
annotation - the annotation
Returns:
true if the annotation is temporary, false otherwise

getTypeLabel

public String getTypeLabel(Annotation annotation)
Description copied from interface: IAnnotationAccessExtension
Returns the label for the given annotation's type.

Specified by:
getTypeLabel in interface IAnnotationAccessExtension
Parameters:
annotation - the annotation
Returns:
the label the given annotation's type or null if no such label exists

getLayer

public int getLayer(Annotation annotation)
Description copied from interface: IAnnotationAccessExtension
Returns the layer for given annotation. Annotations are considered being located at layers and are considered being painted starting with layer 0 upwards. Thus an annotation at layer 5 will be drawn on top of all co-located annotations at the layers 4 - 0.

Specified by:
getLayer in interface IAnnotationAccessExtension
Parameters:
annotation - the annotation
Returns:
the layer of the given annotation

paint

public void paint(Annotation annotation,
                  GC gc,
                  Canvas canvas,
                  Rectangle bounds)
Description copied from interface: IAnnotationAccessExtension
Draws a graphical representation of the given annotation within the given bounds.

Specified by:
paint in interface IAnnotationAccessExtension
Parameters:
annotation - the given annotation
canvas - the canvas to draw on
bounds - the bounds inside the canvas to draw on

isSubtype

public boolean isSubtype(Object annotationType,
                         Object potentialSupertype)
Description copied from interface: IAnnotationAccessExtension
Returns true if the given annotation is of the given type or false otherwise.

Specified by:
isSubtype in interface IAnnotationAccessExtension
Parameters:
annotationType - the annotation type
potentialSupertype - the potential super annotation type
Returns:
true if annotation type is a subtype of the potential annotation super type

getSupertypes

public Object[] getSupertypes(Object annotationType)
Description copied from interface: IAnnotationAccessExtension
Returns the list of super types for the given annotation type. This does not include the type itself.

Specified by:
getSupertypes in interface IAnnotationAccessExtension
Returns:
the super types for the given annotation type

getAnnotationTypeHierarchy

protected AnnotationTypeHierarchy getAnnotationTypeHierarchy()
Returns the annotation type hierarchy used by this annotation access.

Returns:
the annotation type hierarchy
Since:
3.0

Eclipse Platform
Pre-release 3.0

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.